package com.wiscamp.ninechapters.problems.application.assemblers;

import com.wiscamp.ninechapters.problems.application.dto.commands.exams.*;
import com.wiscamp.ninechapters.problems.application.dto.vo.exams.ExamTypeRelationVO;
import com.wiscamp.ninechapters.problems.application.dto.vo.exams.ExamVO;
import com.wiscamp.ninechapters.problems.application.dto.vo.exams.ScoringRuleVO;
import com.wiscamp.ninechapters.problems.domain.models.exams.Exam;
import com.wiscamp.ninechapters.problems.domain.models.exams.ExamTypeRelation;
import com.wiscamp.ninechapters.problems.domain.models.exams.ScoringRule;
import jakarta.validation.constraints.NotNull;
import org.mapstruct.Mapper;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface ExamAssembler {

    ExamAssembler Instance = Mappers.getMapper(ExamAssembler.class);

    // region exam
    ExamVO toExamVO(Exam exam);

    Exam fromCreateCommand(CreateExamCommand command);

    Exam fromUpdateCommand(UpdateExamCommand command);
    // endregion

    // region type relation
    ExamTypeRelationVO toExamTypeRelationVO(@NotNull ExamTypeRelation entity);

    ExamTypeRelation fromCreateCommand(CreateExamTypeRelationCommand command);

    ExamTypeRelation fromUpdateCommand(UpdateExamTypeRelationCommand command);
    // endregion

    // region scoring rule
    ScoringRuleVO toScoringRuleVO(@NotNull ScoringRule entity);

    ScoringRule fromCreateCommand(CreateScoringRuleCommand command);

    ScoringRule fromUpdateCommand(UpdateScoringRuleCommand command);
    // endregion
}
